package com.slz3.business.module.configManagement.conVersion.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conVersion.domain.ConVersion;
import com.slz3.business.module.configManagement.conVersion.domain.ConVersionCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class ConVersionResAtomic extends ConVersionResExecutor {

    public Mono<ServerResponse> add_$ConVersionUpdateLock(ServerRequest req, ConVersion conVersion) {
        return ConVersionResSafeValid.add(req, conVersion) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.add(req, conVersion);
    }

    public Mono<ServerResponse> delete_$ConVersionUpdateLock(ServerRequest req, ConVersionCondition conVersionCondition) {
        return ConVersionResSafeValid.delete(req, conVersionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.delete(req);
    }

    public Mono<ServerResponse> modify_$ConVersionUpdateLock(ServerRequest req, ConVersion conVersion) {
        return ConVersionResSafeValid.modify(req, conVersion) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.modify(req, conVersion);
    }

    public Mono<ServerResponse> info_$ConVersionUpdateLock(ServerRequest req) {
        return ConVersionResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$ConVersionUpdateLock(ServerRequest req, ConVersionCondition conVersionCondition) {
        return ConVersionResSafeValid.auditSubmit(req, conVersionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$ConVersionUpdateLock(ServerRequest req, ConVersionCondition conVersionCondition) {
        return ConVersionResSafeValid.audit(req, conVersionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.audit(req);
    }

    public Mono<ServerResponse> auditReject_$ConVersionUpdateLock(ServerRequest req, ConVersionCondition conVersionCondition) {
        return ConVersionResSafeValid.auditReject(req, conVersionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$ConVersionUpdateLock(ServerRequest req, ConVersionCondition conVersionCondition) {
        return ConVersionResSafeValid.usingEnable(req, conVersionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$ConVersionUpdateLock(ServerRequest req, ConVersionCondition conVersionCondition) {
        return ConVersionResSafeValid.usingDisable(req, conVersionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.usingDisable(req);
    }
}
